4 // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
6 // The use and distribution terms for this software are contained in the file
7 // named license.txt, which can be found in the root of this distribution.
8 // By using this software in any fashion, you are agreeing to be bound by the
9 // terms of this license.
11 // You must not remove this notice, or any other, from this software.
15 // nmtime.h - defines DOS packed date and time types
18 // This file defines the DOS packed date and time types.
21 #define MASK4 0xf // 4 bit mask
22 #define MASK5 0x1f // 5 bit mask
23 #define MASK6 0x3f // 6 bit mask
24 #define MASK7 0x7f // 7 bit mask
26 #define DAYLOC 0 // day value starts in bit 0
27 #define MONTHLOC 5 // month value starts in bit 5
28 #define YEARLOC 9 // year value starts in bit 9
30 #define SECLOC 0 // seconds value starts in bit 0
31 #define MINLOC 5 // minutes value starts in bit 5
32 #define HOURLOC 11 // hours value starts in bit 11
34 #define DOS_DAY(dword) (((dword) >> DAYLOC) & MASK5)
35 #define DOS_MONTH(dword) (((dword) >> MONTHLOC) & MASK4)
36 #define DOS_YEAR(dword) (((dword) >> YEARLOC) & MASK7)
38 #define DOS_HOUR(tword) (((tword) >> HOURLOC) & MASK5)
39 #define DOS_MIN(tword) (((tword) >> MINLOC) & MASK6)
40 #define DOS_SEC(tword) (((tword) >> SECLOC) & MASK5)
42 extern time_t CDECL
_dostotime_t(int, int, int, int, int, int);
44 #define XTIME(d,t) _dostotime_t(DOS_YEAR(d), \